package com.ee.chat.admin.controller.operatemanage;

import com.ee.chat.admin.service.ICallService;
import com.ee.chat.common.bean.Result;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @Author Shane
 * @Date 2020/3/2 17:24
 */
@RestController
@RequestMapping("operate/call")
public class CallController {
    private Logger log = LoggerFactory.getLogger(this.getClass());

    @Resource
    ICallService callService;

    @RequestMapping("list")
    public Result list(HttpServletRequest request, Integer fromUserId, Integer toUserId, Integer callTimeMin,
                       Integer callTimeMax, Integer type, Integer vstatus, String time, String field, String sort,
                       @RequestParam Integer page, @RequestParam Integer limit){
        try {
            return callService.list(request, fromUserId, toUserId, callTimeMin, callTimeMax, type, vstatus, time, field, sort, page, limit);
        } catch (Exception e){
            log.error("【查询通话明细错误】", e);
        }
        return Result.returnFailure();
    }
}
